//
//  UIButton+AFFApp.h
//  AnyfishApp
//
//  Created by apple on 14-3-25.
//  Copyright (c) 2014年 Anyfish. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "UIButton+BackgroundColor.h"



typedef NS_ENUM(NSUInteger, ButtonEdgeInsetsStyle) {
    ButtonEdgeInsetsStyleImageLeft,
    ButtonEdgeInsetsStyleImageRight,
    ButtonEdgeInsetsStyleImageTop,
    ButtonEdgeInsetsStyleImageBottom
};




@interface UIButton (AFF)

@property (nonatomic, strong) NSString *imageNameSource;    ///< 最后一次赋值的资源图片名称

/** 为按钮添加图标
 @param 图标类型
 @param 是否显示在文字前
 */
- (void)addAwesomeIcon:(FAIcon)icon beforeTitle:(BOOL)before;

/** 设置UIButton的背景色
 
 @param red
 @param green
 @param blue
 @param alpha
 
 */
- (void)customStyle:(CGFloat)r green:(CGFloat)g blue:(CGFloat)b alpha:(CGFloat)a cornerRadius:(CGFloat)radius;

/** 设置UIButton的背景色，alpha 默认为1.0
 
 * @param 16进制字符串 eg: '＃ffffff'
 * @param 圆角大小
 
 */
- (void)customStyle:(NSString*)argb  cornerRadius:(CGFloat)radius;
- (void)customStyleWithColor:(UIColor*)color  cornerRadius:(CGFloat)radius;

/**
 * @function customStyle
 * 带圆角边框的按钮
 * @param 填充颜色值
 * @param 圆角大小
 * @param 边框宽度
 * @param 边框颜色
 
 * @return
 */
- (void)customStyle:(NSString*)argb cornerRadius:(CGFloat)radius borderWidth:(CGFloat)borderwidth borderColorStr:(NSString*) borderColorStr;
- (void)customStyleWithColor:(UIColor*)color cornerRadius:(CGFloat)radius borderWidth:(CGFloat)borderwidth borderColor:(UIColor*)borderColor;

- (void)layoutButtonWithEdgeInsetsStyle:(ButtonEdgeInsetsStyle)style imageTitlespace:(CGFloat)space;

- (void)setImageWithFileNameDownload:(NSString *)name isFull:(BOOL)isFull isBg:(BOOL)isBg;

@end
